<?php
	include("components/timelinetype_block.php");
?>
<img src="images/the_left_gradient.png" width="200px" height="0px" />

<?php

	@session_start();
	$access_token = $_SESSION['access_token'];
	$handler = opendir("/home/glidecas/public_html/chirplace1.0.0.0.com/usr/".$access_token['user_id']."/images");

echo "<h3>".$access_token['screen_name']."'s Images</h3>";

	while ($file = readdir($handler))
	{
		if ($file != '.' && $file != '..')
		{
			$formname = substr($file, 0, strlen($file)-4);
			//need to check if php
			$filetype = substr($file, strlen($file)-4);
			if ($filetype == ".php")
			{
?>
		<div><?php echo $formname; ?><br /><a href="index.php?start=share&type=images&typeid=<?php echo urlencode($formname); ?>&redirect=visualine"><img src="images/icon_share.jpg" border="0" alt="Share" title="Share" /></a><form action="_delete.php" method="post" onsubmit="return confirmDelete('<?php echo urlencode($formname); ?>');" id="inlineform"><input type="hidden" name="type" value="images" /><input type="hidden" name="redirect" value="visualine" /><input type="hidden" name="typeid" value="<?php echo urlencode($formname); ?>" /><input type="image" src="images/delete.gif" border="0" alt="Delete" title="Delete" /></form></div>
<?php
			}
			else if ($filetype == ".pnd")
			{
?>
		<div><?php echo $formname; ?><br /><a href="_accept.php?type=images&typeid=<?php echo urlencode($formname); ?>&redirect=visualine"><img src="images/accept.gif" border="0" alt="Accept" title="Accept" /></a><form action="_delete.php" method="post" onsubmit="return confirmDelete('<?php echo urlencode($formname); ?>');" id="inlineform"><input type="hidden" name="type" value="images" /><input type="hidden" name="redirect" value="visualine" /><input type="hidden" name="typeid" value="<?php echo urlencode($formname); ?>" /><input type="image" src="images/delete.gif" border="0" alt="Delete" title="Delete" /></form></div>
<?php
			}
		}
	}
	closedir($handler);

?>



<a href="index.php?start=createimg"><img src="images/image_new.gif" border="0" alt="Create a new Image" align="left" /></a> <a href="index.php?start=createimg">Create a new Image</a>
<script type="text/javascript">
function confirmDelete(stitle)
{
	var retval = "Are you sure you want to delete " + stitle + "?. There is no UNDO for this action (i.e. its going to be really, really deleted).";
	retval = confirm(retval);
	return retval;
}
</script>
